<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>File Source for QPDB.php</title>
	<link rel="stylesheet" type="text/css" href="../media/style.css">
	<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
	<script src="media/a.js"></script>
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
	<td class="header-top-left"><img src="../media/logo.png" border="0" alt="phpDocumentor " /></td>
    <td class="header-top-right">QueryPath<br /><div class="header-top-right-subpackage">Extension</div></td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td colspan="2" class="header-menu">
      
                        
                                                  		[ <a href="../classtrees_QueryPath.html" class="menu">class tree: QueryPath</a> ]
		[ <a href="../elementindex_QueryPath.html" class="menu">index: QueryPath</a> ]
            [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="195" class="menu">
		<div class="package-title">QueryPath</div>
  <div class="package">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
	</div>
      <b>Packages:</b><br />
  <div class="package">
              <a href="../li_QueryPath.html">QueryPath</a><br />
              <a href="../li_Examples.html">Examples</a><br />
              <a href="../li_Tests.html">Tests</a><br />
      	</div>
      <br />
                        <br />
                      </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file QPDB.php</h1>
<p>Documentation is available at <a href="../QueryPath/Extension/_src---QueryPath---Extension---QPDB.php.html">QPDB.php</a></p>
<div class="src-code"><span class="php">
<ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;package&nbsp;contains&nbsp;classes&nbsp;for&nbsp;handling&nbsp;database&nbsp;transactions&nbsp;from</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*&nbsp;within&nbsp;QueryPath.</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;*&nbsp;The&nbsp;tools&nbsp;here&nbsp;use&nbsp;the&nbsp;PDO&nbsp;(PHP&nbsp;Data&nbsp;Objects)&nbsp;library&nbsp;to&nbsp;execute&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;*&nbsp;functions.</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-doc">&nbsp;*&nbsp;Using&nbsp;tools&nbsp;in&nbsp;this&nbsp;package,&nbsp;you&nbsp;can&nbsp;write&nbsp;QueryPath&nbsp;database&nbsp;queries</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">&nbsp;*&nbsp;that&nbsp;query&nbsp;an&nbsp;RDBMS&nbsp;and&nbsp;then&nbsp;insert&nbsp;the&nbsp;results&nbsp;into&nbsp;the&nbsp;document.</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-doc">&nbsp;*&nbsp;Example:</span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">&nbsp;*&nbsp;&lt;?php</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">&nbsp;*&nbsp;$template&nbsp;=&nbsp;'&lt;?xml&nbsp;version=&quot;1.0&quot;?&gt;&lt;tr&gt;&lt;td&nbsp;class=&quot;colOne&quot;/&gt;&lt;td&nbsp;class=&quot;colTwo&quot;/&gt;&lt;td&nbsp;class=&quot;colThree&quot;/&gt;&lt;/tr&gt;';</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-doc">&nbsp;*&nbsp;$qp&nbsp;=&nbsp;qp(QueryPath::HTML_STUB,&nbsp;'body')&nbsp;//&nbsp;Open&nbsp;a&nbsp;stub&nbsp;HTML&nbsp;doc&nbsp;and&nbsp;select&nbsp;&lt;body/&gt;</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;-&gt;append('&lt;table&gt;&lt;tbody/&gt;&lt;/table&gt;')</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;-&gt;dbInit($this-&gt;dsn)</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;-&gt;queryInto('SELECT&nbsp;*&nbsp;FROM&nbsp;qpdb_test&nbsp;WHERE&nbsp;1',&nbsp;array(),&nbsp;$template)</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;-&gt;doneWithQuery()</span></div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;-&gt;writeHTML();</span></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-doc">&nbsp;*&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-doc">&nbsp;*&nbsp;The&nbsp;code&nbsp;above&nbsp;will&nbsp;take&nbsp;the&nbsp;results&nbsp;of&nbsp;a&nbsp;SQL&nbsp;query&nbsp;and&nbsp;insert&nbsp;them&nbsp;into&nbsp;a&nbsp;n</span></div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-doc">&nbsp;*&nbsp;HTML&nbsp;table.</span></div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-doc">&nbsp;*&nbsp;If&nbsp;you&nbsp;are&nbsp;doing&nbsp;many&nbsp;database&nbsp;operations&nbsp;across&nbsp;multiple&nbsp;QueryPath&nbsp;objects,</span></div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-doc">&nbsp;*&nbsp;it&nbsp;is&nbsp;better&nbsp;to&nbsp;avoid&nbsp;using&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPDB::dbInit()}</span><span class="src-doc">.&nbsp;Instead,&nbsp;you&nbsp;should</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-doc">&nbsp;*&nbsp;call&nbsp;the&nbsp;static&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPDB::baseDB()}</span><span class="src-doc">&nbsp;method&nbsp;to&nbsp;configure&nbsp;a&nbsp;single&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-doc">&nbsp;*&nbsp;connection&nbsp;that&nbsp;can&nbsp;be&nbsp;shared&nbsp;by&nbsp;all&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QueryPath}</span><span class="src-doc">&nbsp;instances.</span></div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a33"></a><span class="src-doc">&nbsp;*&nbsp;Thus,&nbsp;we&nbsp;could&nbsp;rewrite&nbsp;the&nbsp;above&nbsp;to&nbsp;look&nbsp;like&nbsp;this:</span></div></li>
<li><div class="src-line"><a name="a34"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a35"></a><span class="src-doc">&nbsp;&nbsp;*&nbsp;&lt;?php</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-doc">&nbsp;&nbsp;*&nbsp;QPDB::baseDB($someDN);</span></div></li>
<li><div class="src-line"><a name="a37"></a><span class="src-doc">&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a38"></a><span class="src-doc">&nbsp;&nbsp;*&nbsp;$template&nbsp;=&nbsp;'&lt;?xml&nbsp;version=&quot;1.0&quot;?&gt;&lt;tr&gt;&lt;td&nbsp;class=&quot;colOne&quot;/&gt;&lt;td&nbsp;class=&quot;colTwo&quot;/&gt;&lt;td&nbsp;class=&quot;colThree&quot;/&gt;&lt;/tr&gt;';</span></div></li>
<li><div class="src-line"><a name="a39"></a><span class="src-doc">&nbsp;&nbsp;*&nbsp;$qp&nbsp;=&nbsp;qp(QueryPath::HTML_STUB,&nbsp;'body')&nbsp;//&nbsp;Open&nbsp;a&nbsp;stub&nbsp;HTML&nbsp;doc&nbsp;and&nbsp;select&nbsp;&lt;body/&gt;</span></div></li>
<li><div class="src-line"><a name="a40"></a><span class="src-doc">&nbsp;&nbsp;*&nbsp;&nbsp;-&gt;append('&lt;table&gt;&lt;tbody/&gt;&lt;/table&gt;')</span></div></li>
<li><div class="src-line"><a name="a41"></a><span class="src-doc">&nbsp;&nbsp;*&nbsp;&nbsp;-&gt;queryInto('SELECT&nbsp;*&nbsp;FROM&nbsp;qpdb_test&nbsp;WHERE&nbsp;1',&nbsp;array(),&nbsp;$template)</span></div></li>
<li><div class="src-line"><a name="a42"></a><span class="src-doc">&nbsp;&nbsp;*&nbsp;&nbsp;-&gt;doneWithQuery()</span></div></li>
<li><div class="src-line"><a name="a43"></a><span class="src-doc">&nbsp;&nbsp;*&nbsp;&nbsp;-&gt;writeHTML();</span></div></li>
<li><div class="src-line"><a name="a44"></a><span class="src-doc">&nbsp;&nbsp;*&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a45"></a><span class="src-doc">&nbsp;&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a46"></a><span class="src-doc">&nbsp;*&nbsp;Note&nbsp;that&nbsp;in&nbsp;this&nbsp;case,&nbsp;the&nbsp;QueryPath&nbsp;object&nbsp;doesn't&nbsp;need&nbsp;to&nbsp;call&nbsp;a&nbsp;method&nbsp;to</span></div></li>
<li><div class="src-line"><a name="a47"></a><span class="src-doc">&nbsp;*&nbsp;activate&nbsp;the&nbsp;database.&nbsp;There&nbsp;is&nbsp;no&nbsp;call&nbsp;to&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;dbInit()}</span><span class="src-doc">.&nbsp;Instead,&nbsp;it&nbsp;checks</span></div></li>
<li><div class="src-line"><a name="a48"></a><span class="src-doc">&nbsp;*&nbsp;the&nbsp;base&nbsp;class&nbsp;to&nbsp;find&nbsp;the&nbsp;shared&nbsp;database.</span></div></li>
<li><div class="src-line"><a name="a49"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a50"></a><span class="src-doc">&nbsp;*&nbsp;(Note&nbsp;that&nbsp;if&nbsp;you&nbsp;were&nbsp;to&nbsp;add&nbsp;a&nbsp;dbInit()&nbsp;call&nbsp;to&nbsp;the&nbsp;above,&nbsp;it&nbsp;would&nbsp;create</span></div></li>
<li><div class="src-line"><a name="a51"></a><span class="src-doc">&nbsp;*&nbsp;a&nbsp;new&nbsp;database&nbsp;connection.)</span></div></li>
<li><div class="src-line"><a name="a52"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a53"></a><span class="src-doc">&nbsp;*&nbsp;The&nbsp;result&nbsp;of&nbsp;both&nbsp;of&nbsp;these&nbsp;examples&nbsp;will&nbsp;be&nbsp;identical.</span></div></li>
<li><div class="src-line"><a name="a54"></a><span class="src-doc">&nbsp;*&nbsp;The&nbsp;output&nbsp;looks&nbsp;something&nbsp;like&nbsp;this:</span></div></li>
<li><div class="src-line"><a name="a55"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a56"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a57"></a><span class="src-doc">&nbsp;*&nbsp;&lt;!DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;&quot;-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Strict//EN&quot;&nbsp;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a58"></a><span class="src-doc">&nbsp;*&nbsp;&lt;html&nbsp;xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a59"></a><span class="src-doc">&nbsp;*&nbsp;&lt;head&gt;</span></div></li>
<li><div class="src-line"><a name="a60"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;meta&nbsp;http-equiv=&quot;Content-Type&quot;&nbsp;content=&quot;text/html;&nbsp;charset=utf-8&quot;&gt;&lt;/meta&gt;</span></div></li>
<li><div class="src-line"><a name="a61"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;Untitled&lt;/title&gt;</span></div></li>
<li><div class="src-line"><a name="a62"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/head&gt;</span></div></li>
<li><div class="src-line"><a name="a63"></a><span class="src-doc">&nbsp;*&lt;body&gt;</span></div></li>
<li><div class="src-line"><a name="a64"></a><span class="src-doc">&nbsp;*&lt;table&gt;</span></div></li>
<li><div class="src-line"><a name="a65"></a><span class="src-doc">&nbsp;*&nbsp;&lt;tbody&gt;</span></div></li>
<li><div class="src-line"><a name="a66"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;tr&gt;</span></div></li>
<li><div class="src-line"><a name="a67"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colOne&quot;&gt;Title&nbsp;0&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a68"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colTwo&quot;&gt;Body&nbsp;0&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a69"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colThree&quot;&gt;Footer&nbsp;0&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a70"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;/tr&gt;</span></div></li>
<li><div class="src-line"><a name="a71"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;tr&gt;</span></div></li>
<li><div class="src-line"><a name="a72"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colOne&quot;&gt;Title&nbsp;1&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a73"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colTwo&quot;&gt;Body&nbsp;1&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a74"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colThree&quot;&gt;Footer&nbsp;1&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a75"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;/tr&gt;</span></div></li>
<li><div class="src-line"><a name="a76"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;tr&gt;</span></div></li>
<li><div class="src-line"><a name="a77"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colOne&quot;&gt;Title&nbsp;2&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a78"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colTwo&quot;&gt;Body&nbsp;2&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a79"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colThree&quot;&gt;Footer&nbsp;2&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a80"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;/tr&gt;</span></div></li>
<li><div class="src-line"><a name="a81"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;tr&gt;</span></div></li>
<li><div class="src-line"><a name="a82"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colOne&quot;&gt;Title&nbsp;3&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a83"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colTwo&quot;&gt;Body&nbsp;3&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a84"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colThree&quot;&gt;Footer&nbsp;3&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a85"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;/tr&gt;</span></div></li>
<li><div class="src-line"><a name="a86"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;tr&gt;</span></div></li>
<li><div class="src-line"><a name="a87"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colOne&quot;&gt;Title&nbsp;4&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a88"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colTwo&quot;&gt;Body&nbsp;4&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a89"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;td&nbsp;class=&quot;colThree&quot;&gt;Footer&nbsp;4&lt;/td&gt;</span></div></li>
<li><div class="src-line"><a name="a90"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&lt;/tr&gt;</span></div></li>
<li><div class="src-line"><a name="a91"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/tbody&gt;</span></div></li>
<li><div class="src-line"><a name="a92"></a><span class="src-doc">&nbsp;*&lt;/table&gt;</span></div></li>
<li><div class="src-line"><a name="a93"></a><span class="src-doc">&nbsp;*&lt;/body&gt;</span></div></li>
<li><div class="src-line"><a name="a94"></a><span class="src-doc">&nbsp;*&lt;/html&gt;</span></div></li>
<li><div class="src-line"><a name="a95"></a><span class="src-doc">&nbsp;*&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a96"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a97"></a><span class="src-doc">&nbsp;*&nbsp;Note&nbsp;how&nbsp;the&nbsp;CSS&nbsp;classes&nbsp;are&nbsp;used&nbsp;to&nbsp;correlate&nbsp;DB&nbsp;table&nbsp;names&nbsp;to&nbsp;template</span></div></li>
<li><div class="src-line"><a name="a98"></a><span class="src-doc">&nbsp;*&nbsp;locations.</span></div></li>
<li><div class="src-line"><a name="a99"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;QueryPath</span></div></li>
<li><div class="src-line"><a name="a100"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@subpackage</span><span class="src-doc">&nbsp;Extension</span></div></li>
<li><div class="src-line"><a name="a101"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;M&nbsp;Butcher&nbsp;&lt;matt@aleph-null.tv&gt;</span></div></li>
<li><div class="src-line"><a name="a102"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@license</span><span class="src-doc">&nbsp;http://opensource.org/licenses/lgpl-2.1.php&nbsp;LGPL&nbsp;or&nbsp;MIT-like&nbsp;license.</span></div></li>
<li><div class="src-line"><a name="a103"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QueryPathExtension</span></div></li>
<li><div class="src-line"><a name="a104"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QueryPathExtensionRegistry::extend()</span></div></li>
<li><div class="src-line"><a name="a105"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QPDB</span></div></li>
<li><div class="src-line"><a name="a106"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a107"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a108"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a109"></a><span class="src-doc">&nbsp;*&nbsp;Provide&nbsp;DB&nbsp;access&nbsp;to&nbsp;a&nbsp;QueryPath&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a110"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a111"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;extension&nbsp;provides&nbsp;tools&nbsp;for&nbsp;communicating&nbsp;with&nbsp;a&nbsp;database&nbsp;using&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a112"></a><span class="src-doc">&nbsp;*&nbsp;QueryPath&nbsp;library.&nbsp;It&nbsp;relies&nbsp;upon&nbsp;PDO&nbsp;for&nbsp;underlying&nbsp;database&nbsp;communiction.&nbsp;This</span></div></li>
<li><div class="src-line"><a name="a113"></a><span class="src-doc">&nbsp;*&nbsp;means&nbsp;that&nbsp;it&nbsp;supports&nbsp;all&nbsp;databases&nbsp;that&nbsp;PDO&nbsp;supports,&nbsp;including&nbsp;MySQL,</span></div></li>
<li><div class="src-line"><a name="a114"></a><span class="src-doc">&nbsp;*&nbsp;PostgreSQL,&nbsp;and&nbsp;SQLite.</span></div></li>
<li><div class="src-line"><a name="a115"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a116"></a><span class="src-doc">&nbsp;*&nbsp;Here&nbsp;is&nbsp;an&nbsp;extended&nbsp;example&nbsp;taken&nbsp;from&nbsp;the&nbsp;unit&nbsp;tests&nbsp;for&nbsp;this&nbsp;library.</span></div></li>
<li><div class="src-line"><a name="a117"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a118"></a><span class="src-doc">&nbsp;*&nbsp;Let's&nbsp;say&nbsp;we&nbsp;create&nbsp;a&nbsp;database&nbsp;with&nbsp;code&nbsp;like&nbsp;this:</span></div></li>
<li><div class="src-line"><a name="a119"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a120"></a><span class="src-doc">&nbsp;*&lt;?php</span></div></li>
<li><div class="src-line"><a name="a121"></a><span class="src-doc">&nbsp;*&nbsp;public&nbsp;function&nbsp;setUp()&nbsp;{</span></div></li>
<li><div class="src-line"><a name="a122"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;$this-&gt;db&nbsp;=&nbsp;new&nbsp;PDO($this-&gt;dsn);</span></div></li>
<li><div class="src-line"><a name="a123"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;$this-&gt;db-&gt;setAttribute(PDO::ATTR_ERRMODE,&nbsp;PDO::ERRMODE_EXCEPTION);</span></div></li>
<li><div class="src-line"><a name="a124"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;$this-&gt;db-&gt;exec('CREATE&nbsp;TABLE&nbsp;IF&nbsp;NOT&nbsp;EXISTS&nbsp;qpdb_test&nbsp;(colOne,&nbsp;colTwo,&nbsp;colThree)');</span></div></li>
<li><div class="src-line"><a name="a125"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a126"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;$stmt&nbsp;=&nbsp;$this-&gt;db-&gt;prepare(</span></div></li>
<li><div class="src-line"><a name="a127"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'INSERT&nbsp;INTO&nbsp;qpdb_test&nbsp;(colOne,&nbsp;colTwo,&nbsp;colThree)&nbsp;VALUES&nbsp;(:one,&nbsp;:two,&nbsp;:three)'</span></div></li>
<li><div class="src-line"><a name="a128"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;);</span></div></li>
<li><div class="src-line"><a name="a129"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a130"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;for&nbsp;($i&nbsp;=&nbsp;0;&nbsp;$i&nbsp;&lt;&nbsp;5;&nbsp;++$i)&nbsp;{</span></div></li>
<li><div class="src-line"><a name="a131"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$vals&nbsp;=&nbsp;array(':one'&nbsp;=&gt;&nbsp;'Title&nbsp;'&nbsp;.&nbsp;$i,&nbsp;':two'&nbsp;=&gt;&nbsp;'Body&nbsp;'&nbsp;.&nbsp;$i,&nbsp;':three'&nbsp;=&gt;&nbsp;'Footer&nbsp;'&nbsp;.&nbsp;$i);</span></div></li>
<li><div class="src-line"><a name="a132"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$stmt-&gt;execute($vals);</span></div></li>
<li><div class="src-line"><a name="a133"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$stmt-&gt;closeCursor();</span></div></li>
<li><div class="src-line"><a name="a134"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a135"></a><span class="src-doc">&nbsp;*&nbsp;}</span></div></li>
<li><div class="src-line"><a name="a136"></a><span class="src-doc">&nbsp;*&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a137"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a138"></a><span class="src-doc">&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a139"></a><span class="src-doc">&nbsp;*&nbsp;From&nbsp;QueryPath&nbsp;with&nbsp;QPDB,&nbsp;we&nbsp;can&nbsp;now&nbsp;do&nbsp;very&nbsp;elaborate&nbsp;DB&nbsp;chains&nbsp;like&nbsp;this:</span></div></li>
<li><div class="src-line"><a name="a140"></a><span class="src-doc">&nbsp;*&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a141"></a><span class="src-doc">&nbsp;*&nbsp;&lt;?php</span></div></li>
<li><div class="src-line"><a name="a142"></a><span class="src-doc">&nbsp;*&nbsp;$sql&nbsp;=&nbsp;'SELECT&nbsp;*&nbsp;FROM&nbsp;qpdb_test';</span></div></li>
<li><div class="src-line"><a name="a143"></a><span class="src-doc">&nbsp;*&nbsp;$args&nbsp;=&nbsp;array();</span></div></li>
<li><div class="src-line"><a name="a144"></a><span class="src-doc">&nbsp;*&nbsp;$qp&nbsp;=&nbsp;qp(QueryPath::HTML_STUB,&nbsp;'body')&nbsp;//&nbsp;Open&nbsp;a&nbsp;stub&nbsp;HTML&nbsp;doc&nbsp;and&nbsp;select&nbsp;&lt;body/&gt;</span></div></li>
<li><div class="src-line"><a name="a145"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;append('&lt;h1&gt;&lt;/h1&gt;')&nbsp;//&nbsp;Add&nbsp;&lt;h1/&gt;</span></div></li>
<li><div class="src-line"><a name="a146"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;children()&nbsp;&nbsp;//&nbsp;Select&nbsp;the&nbsp;&lt;h1/&gt;</span></div></li>
<li><div class="src-line"><a name="a147"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;dbInit($this-&gt;dsn)&nbsp;//&nbsp;Connect&nbsp;to&nbsp;the&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a148"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;query($sql,&nbsp;$args)&nbsp;//&nbsp;Execute&nbsp;the&nbsp;SQL&nbsp;query</span></div></li>
<li><div class="src-line"><a name="a149"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;nextRow()&nbsp;&nbsp;//&nbsp;Select&nbsp;a&nbsp;row.&nbsp;By&nbsp;default,&nbsp;no&nbsp;row&nbsp;is&nbsp;selected.</span></div></li>
<li><div class="src-line"><a name="a150"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;appendColumn('colOne')&nbsp;//&nbsp;Append&nbsp;Row&nbsp;1,&nbsp;Col&nbsp;1&nbsp;(Title&nbsp;0)</span></div></li>
<li><div class="src-line"><a name="a151"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;parent()&nbsp;//&nbsp;Go&nbsp;back&nbsp;to&nbsp;the&nbsp;&lt;body/&gt;</span></div></li>
<li><div class="src-line"><a name="a152"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;append('&lt;p/&gt;')&nbsp;//&nbsp;Append&nbsp;a&nbsp;&lt;p/&gt;&nbsp;to&nbsp;the&nbsp;body</span></div></li>
<li><div class="src-line"><a name="a153"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;find('p')&nbsp;&nbsp;//&nbsp;Find&nbsp;the&nbsp;&lt;p/&gt;&nbsp;we&nbsp;just&nbsp;created.</span></div></li>
<li><div class="src-line"><a name="a154"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;nextRow()&nbsp;//&nbsp;Advance&nbsp;to&nbsp;row&nbsp;2</span></div></li>
<li><div class="src-line"><a name="a155"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;prependColumn('colTwo')&nbsp;//&nbsp;Get&nbsp;row&nbsp;2,&nbsp;col&nbsp;2.&nbsp;(Body&nbsp;1)</span></div></li>
<li><div class="src-line"><a name="a156"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;columnAfter('colThree')&nbsp;//&nbsp;Get&nbsp;row&nbsp;2&nbsp;col&nbsp;3.&nbsp;(Footer&nbsp;1)</span></div></li>
<li><div class="src-line"><a name="a157"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;doneWithQuery()&nbsp;//&nbsp;Let&nbsp;QueryPath&nbsp;clean&nbsp;up.&nbsp;YOU&nbsp;SHOULD&nbsp;ALWAYS&nbsp;DO&nbsp;THIS.</span></div></li>
<li><div class="src-line"><a name="a158"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;writeHTML();&nbsp;//&nbsp;Write&nbsp;the&nbsp;output&nbsp;as&nbsp;HTML.</span></div></li>
<li><div class="src-line"><a name="a159"></a><span class="src-doc">&nbsp;*&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a160"></a><span class="src-doc">&nbsp;*&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a161"></a><span class="src-doc">&nbsp;*&nbsp;With&nbsp;the&nbsp;code&nbsp;above,&nbsp;we&nbsp;step&nbsp;through&nbsp;the&nbsp;document,&nbsp;selectively&nbsp;building&nbsp;elements</span></div></li>
<li><div class="src-line"><a name="a162"></a><span class="src-doc">&nbsp;*&nbsp;as&nbsp;we&nbsp;go,&nbsp;and&nbsp;then&nbsp;populating&nbsp;this&nbsp;elements&nbsp;with&nbsp;data&nbsp;from&nbsp;our&nbsp;initial&nbsp;query.</span></div></li>
<li><div class="src-line"><a name="a163"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a164"></a><span class="src-doc">&nbsp;*&nbsp;When&nbsp;the&nbsp;last&nbsp;command,&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QueryPath:::writeHTML()}</span><span class="src-doc">,&nbsp;is&nbsp;run,&nbsp;we&nbsp;will&nbsp;get&nbsp;output</span></div></li>
<li><div class="src-line"><a name="a165"></a><span class="src-doc">&nbsp;*&nbsp;like&nbsp;this:</span></div></li>
<li><div class="src-line"><a name="a166"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a167"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;!DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;&quot;-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Strict//EN&quot;&nbsp;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a168"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;html&nbsp;xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a169"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;head&gt;</span></div></li>
<li><div class="src-line"><a name="a170"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;meta&nbsp;http-equiv=&quot;Content-Type&quot;&nbsp;content=&quot;text/html;&nbsp;charset=utf-8&quot;&nbsp;/&gt;</span></div></li>
<li><div class="src-line"><a name="a171"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;Untitled&lt;/title&gt;</span></div></li>
<li><div class="src-line"><a name="a172"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/head&gt;</span></div></li>
<li><div class="src-line"><a name="a173"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;body&gt;</span></div></li>
<li><div class="src-line"><a name="a174"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h1&gt;Title&nbsp;0&lt;/h1&gt;</span></div></li>
<li><div class="src-line"><a name="a175"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;Body&nbsp;1&lt;/p&gt;</span></div></li>
<li><div class="src-line"><a name="a176"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Footer&nbsp;1&lt;/body&gt;</span></div></li>
<li><div class="src-line"><a name="a177"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;/html&gt;</span></div></li>
<li><div class="src-line"><a name="a178"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a179"></a><span class="src-doc">&nbsp;*&nbsp;Notice&nbsp;the&nbsp;body&nbsp;section&nbsp;in&nbsp;particular.&nbsp;This&nbsp;is&nbsp;where&nbsp;the&nbsp;data&nbsp;has&nbsp;been</span></div></li>
<li><div class="src-line"><a name="a180"></a><span class="src-doc">&nbsp;*&nbsp;inserted.</span></div></li>
<li><div class="src-line"><a name="a181"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a182"></a><span class="src-doc">&nbsp;*&nbsp;Sometimes&nbsp;you&nbsp;want&nbsp;to&nbsp;do&nbsp;something&nbsp;a&nbsp;lot&nbsp;simpler,&nbsp;like&nbsp;give&nbsp;QueryPath&nbsp;a</span></div></li>
<li><div class="src-line"><a name="a183"></a><span class="src-doc">&nbsp;*&nbsp;template&nbsp;and&nbsp;have&nbsp;it&nbsp;navigate&nbsp;a&nbsp;query,&nbsp;inserting&nbsp;the&nbsp;data&nbsp;into&nbsp;a&nbsp;template,&nbsp;and</span></div></li>
<li><div class="src-line"><a name="a184"></a><span class="src-doc">&nbsp;*&nbsp;then&nbsp;inserting&nbsp;the&nbsp;template&nbsp;into&nbsp;the&nbsp;document.&nbsp;This&nbsp;can&nbsp;be&nbsp;done&nbsp;simply&nbsp;with</span></div></li>
<li><div class="src-line"><a name="a185"></a><span class="src-doc">&nbsp;*&nbsp;the&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;queryInto()}</span><span class="src-doc">&nbsp;function.</span></div></li>
<li><div class="src-line"><a name="a186"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a187"></a><span class="src-doc">&nbsp;*&nbsp;Here's&nbsp;an&nbsp;example&nbsp;from&nbsp;another&nbsp;unit&nbsp;test:</span></div></li>
<li><div class="src-line"><a name="a188"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a189"></a><span class="src-doc">&nbsp;*&nbsp;&lt;?php</span></div></li>
<li><div class="src-line"><a name="a190"></a><span class="src-doc">&nbsp;*&nbsp;$template&nbsp;=&nbsp;'&lt;?xml&nbsp;version=&quot;1.0&quot;?&gt;&lt;li&nbsp;class=&quot;colOne&quot;/&gt;';</span></div></li>
<li><div class="src-line"><a name="a191"></a><span class="src-doc">&nbsp;*&nbsp;$sql&nbsp;=&nbsp;'SELECT&nbsp;*&nbsp;FROM&nbsp;qpdb_test';</span></div></li>
<li><div class="src-line"><a name="a192"></a><span class="src-doc">&nbsp;*&nbsp;$args&nbsp;=&nbsp;array();</span></div></li>
<li><div class="src-line"><a name="a193"></a><span class="src-doc">&nbsp;*&nbsp;$qp&nbsp;=&nbsp;qp(QueryPath::HTML_STUB,&nbsp;'body')</span></div></li>
<li><div class="src-line"><a name="a194"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;append('&lt;ul/&gt;')&nbsp;//&nbsp;Add&nbsp;a&nbsp;new&nbsp;&lt;ul/&gt;</span></div></li>
<li><div class="src-line"><a name="a195"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;children()&nbsp;//&nbsp;Select&nbsp;the&nbsp;&lt;ul/&gt;</span></div></li>
<li><div class="src-line"><a name="a196"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;dbInit($this-&gt;dsn)&nbsp;//&nbsp;Initialize&nbsp;the&nbsp;DB</span></div></li>
<li><div class="src-line"><a name="a197"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;//&nbsp;BIG&nbsp;LINE:&nbsp;Query&nbsp;the&nbsp;results,&nbsp;run&nbsp;them&nbsp;through&nbsp;the&nbsp;template,&nbsp;and&nbsp;insert&nbsp;them.</span></div></li>
<li><div class="src-line"><a name="a198"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;queryInto($sql,&nbsp;$args,&nbsp;$template)</span></div></li>
<li><div class="src-line"><a name="a199"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;doneWithQuery()</span></div></li>
<li><div class="src-line"><a name="a200"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;-&gt;writeHTML();&nbsp;//&nbsp;Write&nbsp;the&nbsp;results&nbsp;as&nbsp;HTML.</span></div></li>
<li><div class="src-line"><a name="a201"></a><span class="src-doc">&nbsp;*&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a202"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a203"></a><span class="src-doc">&nbsp;*&nbsp;The&nbsp;simple&nbsp;code&nbsp;above&nbsp;puts&nbsp;the&nbsp;first&nbsp;column&nbsp;of&nbsp;the&nbsp;select&nbsp;statement</span></div></li>
<li><div class="src-line"><a name="a204"></a><span class="src-doc">&nbsp;*&nbsp;into&nbsp;an&nbsp;unordered&nbsp;list.&nbsp;The&nbsp;example&nbsp;output&nbsp;looks&nbsp;like&nbsp;this:</span></div></li>
<li><div class="src-line"><a name="a205"></a><span class="src-doc">&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a206"></a><span class="src-doc">&nbsp;*&nbsp;&lt;!DOCTYPE&nbsp;html&nbsp;PUBLIC&nbsp;&quot;-//W3C//DTD&nbsp;XHTML&nbsp;1.0&nbsp;Strict//EN&quot;&nbsp;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a207"></a><span class="src-doc">&nbsp;*&nbsp;&lt;html&nbsp;xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a208"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;head&gt;</span></div></li>
<li><div class="src-line"><a name="a209"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;meta&nbsp;http-equiv=&quot;Content-Type&quot;&nbsp;content=&quot;text/html;&nbsp;charset=utf-8&quot;&gt;&lt;/meta&gt;</span></div></li>
<li><div class="src-line"><a name="a210"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;Untitled&lt;/title&gt;</span></div></li>
<li><div class="src-line"><a name="a211"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;/head&gt;</span></div></li>
<li><div class="src-line"><a name="a212"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;body&gt;</span></div></li>
<li><div class="src-line"><a name="a213"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;</span></div></li>
<li><div class="src-line"><a name="a214"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;colOne&quot;&gt;Title&nbsp;0&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a215"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;colOne&quot;&gt;Title&nbsp;1&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a216"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;colOne&quot;&gt;Title&nbsp;2&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a217"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;colOne&quot;&gt;Title&nbsp;3&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a218"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;colOne&quot;&gt;Title&nbsp;4&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a219"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;</span></div></li>
<li><div class="src-line"><a name="a220"></a><span class="src-doc">&nbsp;*&nbsp;&nbsp;&nbsp;&lt;/body&gt;</span></div></li>
<li><div class="src-line"><a name="a221"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/html&gt;</span></div></li>
<li><div class="src-line"><a name="a222"></a><span class="src-doc">&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a223"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a224"></a><span class="src-doc">&nbsp;*&nbsp;Typical&nbsp;starting&nbsp;methods&nbsp;for&nbsp;this&nbsp;class&nbsp;are&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPDB::baseDB()}</span><span class="src-doc">,</span></div></li>
<li><div class="src-line"><a name="a225"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPDB::query()}</span><span class="src-doc">,&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPDB::queryInto()}</span><span class="src-doc">.</span></div></li>
<li><div class="src-line"><a name="a226"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a227"></a><span class="src-key">class&nbsp;</span><a href="../QueryPath/Extension/QPDB.html">QPDB</a>&nbsp;<span class="src-key">implements&nbsp;</span><span class="src-id">QueryPathExtension&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a228"></a>&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">$qp</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a229"></a>&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#var$dsn">$dsn</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a230"></a>&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#var$db">$db</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a231"></a>&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#var$opts">$opts</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a232"></a>&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#var$row">$row</a>&nbsp;=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a233"></a>&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#var$stmt">$stmt</a>&nbsp;=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a234"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a235"></a>&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><span class="src-key">static&nbsp;</span><span class="src-var">$con&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a236"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a237"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a238"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Create&nbsp;a&nbsp;new&nbsp;database&nbsp;instance&nbsp;for&nbsp;all&nbsp;QueryPath&nbsp;objects&nbsp;to&nbsp;share.</span></div></li>
<li><div class="src-line"><a name="a239"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a240"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;method&nbsp;need&nbsp;be&nbsp;called&nbsp;only&nbsp;once.&nbsp;From&nbsp;there,&nbsp;other&nbsp;QPDB&nbsp;instances</span></div></li>
<li><div class="src-line"><a name="a241"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;will&nbsp;(by&nbsp;default)&nbsp;share&nbsp;the&nbsp;same&nbsp;database&nbsp;instance.</span></div></li>
<li><div class="src-line"><a name="a242"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a243"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Normally,&nbsp;a&nbsp;DSN&nbsp;should&nbsp;be&nbsp;passed&nbsp;in.&nbsp;Username,&nbsp;password,&nbsp;and&nbsp;db&nbsp;params</span></div></li>
<li><div class="src-line"><a name="a244"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;are&nbsp;all&nbsp;passed&nbsp;in&nbsp;using&nbsp;the&nbsp;options&nbsp;array.</span></div></li>
<li><div class="src-line"><a name="a245"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a246"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;On&nbsp;rare&nbsp;occasions,&nbsp;it&nbsp;may&nbsp;be&nbsp;more&nbsp;fitting&nbsp;to&nbsp;pass&nbsp;in&nbsp;an&nbsp;existing&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a247"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;connection&nbsp;(which&nbsp;must&nbsp;be&nbsp;a&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;PDO}</span><span class="src-doc">&nbsp;object).&nbsp;In&nbsp;such&nbsp;cases,&nbsp;the&nbsp;$dsn</span></div></li>
<li><div class="src-line"><a name="a248"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;parameter&nbsp;can&nbsp;take&nbsp;a&nbsp;PDO&nbsp;object&nbsp;instead&nbsp;of&nbsp;a&nbsp;DSN&nbsp;string.&nbsp;The&nbsp;standard&nbsp;options</span></div></li>
<li><div class="src-line"><a name="a249"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;will&nbsp;be&nbsp;ignored,&nbsp;though.</span></div></li>
<li><div class="src-line"><a name="a250"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a251"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&lt;b&gt;Warning:&lt;/b&gt;&nbsp;If&nbsp;you&nbsp;pass&nbsp;in&nbsp;a&nbsp;PDO&nbsp;object&nbsp;that&nbsp;is&nbsp;configured&nbsp;to&nbsp;NOT&nbsp;throw</span></div></li>
<li><div class="src-line"><a name="a252"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;exceptions,&nbsp;you&nbsp;will&nbsp;need&nbsp;to&nbsp;handle&nbsp;error&nbsp;checking&nbsp;differently.</span></div></li>
<li><div class="src-line"><a name="a253"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a254"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&lt;b&gt;Remember&nbsp;to&nbsp;always&nbsp;use&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPDB::doneWithQuery()}</span><span class="src-doc">&nbsp;when&nbsp;you&nbsp;are&nbsp;done</span></div></li>
<li><div class="src-line"><a name="a255"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;with&nbsp;a&nbsp;query.&nbsp;It&nbsp;gives&nbsp;PDO&nbsp;a&nbsp;chance&nbsp;to&nbsp;clean&nbsp;up&nbsp;open&nbsp;connections&nbsp;that&nbsp;may</span></div></li>
<li><div class="src-line"><a name="a256"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;prevent&nbsp;other&nbsp;instances&nbsp;from&nbsp;accessing&nbsp;or&nbsp;modifying&nbsp;data.&lt;/b&gt;</span></div></li>
<li><div class="src-line"><a name="a257"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a258"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$dsn&nbsp;</span></div></li>
<li><div class="src-line"><a name="a259"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;DSN&nbsp;of&nbsp;the&nbsp;database&nbsp;to&nbsp;connect&nbsp;to.&nbsp;You&nbsp;can&nbsp;also&nbsp;pass&nbsp;in&nbsp;a&nbsp;PDO&nbsp;object,&nbsp;which</span></div></li>
<li><div class="src-line"><a name="a260"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;will&nbsp;set&nbsp;the&nbsp;QPDB&nbsp;object's&nbsp;database&nbsp;to&nbsp;the&nbsp;one&nbsp;passed&nbsp;in.</span></div></li>
<li><div class="src-line"><a name="a261"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc-var">$options&nbsp;</span></div></li>
<li><div class="src-line"><a name="a262"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;An&nbsp;array&nbsp;of&nbsp;configuration&nbsp;options.&nbsp;The&nbsp;following&nbsp;options&nbsp;are&nbsp;currently&nbsp;supported:</span></div></li>
<li><div class="src-line"><a name="a263"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;-&nbsp;username&nbsp;=&gt;&nbsp;(string)</span></div></li>
<li><div class="src-line"><a name="a264"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;-&nbsp;password&nbsp;=&gt;&nbsp;(string)</span></div></li>
<li><div class="src-line"><a name="a265"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;-&nbsp;db&nbsp;params&nbsp;=&gt;&nbsp;(array)&nbsp;These&nbsp;will&nbsp;be&nbsp;passed&nbsp;into&nbsp;the&nbsp;new&nbsp;PDO&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a266"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;See&nbsp;the&nbsp;PDO&nbsp;documentation&nbsp;for&nbsp;a&nbsp;list&nbsp;of&nbsp;options.&nbsp;By&nbsp;default,&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a267"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;flag&nbsp;set&nbsp;is&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;PDO::ATTR_ERRMODE}</span><span class="src-doc">,&nbsp;which&nbsp;is&nbsp;set&nbsp;to</span></div></li>
<li><div class="src-line"><a name="a268"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;PDO::ERRMODE_EXCEPTION}</span><span class="src-doc">.</span></div></li>
<li><div class="src-line"><a name="a269"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@throws</span><span class="src-doc">&nbsp;PDOException</span></div></li>
<li><div class="src-line"><a name="a270"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;An&nbsp;exception&nbsp;may&nbsp;be&nbsp;thrown&nbsp;if&nbsp;the&nbsp;connection&nbsp;cannot&nbsp;be&nbsp;made.</span></div></li>
<li><div class="src-line"><a name="a271"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a272"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodbaseDB">baseDB</a><span class="src-sym">(</span><span class="src-var">$dsn</span><span class="src-sym">,&nbsp;</span><span class="src-var">$options&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a273"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a274"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$opts&nbsp;</span>=&nbsp;<span class="src-var">$options&nbsp;</span>+&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a275"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'username'&nbsp;</span>=&gt;&nbsp;<span class="src-id">NULL</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a276"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'password'&nbsp;</span>=&gt;&nbsp;<span class="src-id">NULL</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a277"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'db&nbsp;params'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-id">PDO</span><span class="src-sym">::</span><span class="src-id">ATTR_ERRMODE&nbsp;</span>=&gt;&nbsp;<span class="src-id">PDO</span><span class="src-sym">::</span><span class="src-id">ERRMODE_EXCEPTION</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a278"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a279"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a280"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Allow&nbsp;this&nbsp;to&nbsp;handle&nbsp;the&nbsp;case&nbsp;where&nbsp;an&nbsp;outside</span></div></li>
<li><div class="src-line"><a name="a281"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;connection&nbsp;does&nbsp;the&nbsp;initialization.</span></div></li>
<li><div class="src-line"><a name="a282"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$dsn&nbsp;</span>instanceof&nbsp;<span class="src-id">PDO</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a283"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$con&nbsp;</span>=&nbsp;<span class="src-var">$dsn</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a284"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a285"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a286"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$con&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">PDO</span><span class="src-sym">(</span><span class="src-var">$dsn</span><span class="src-sym">,&nbsp;</span><span class="src-var">$opts</span><span class="src-sym">[</span><span class="src-str">'username'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-var">$opts</span><span class="src-sym">[</span><span class="src-str">'password'</span><span class="src-sym">]</span><span class="src-sym">,&nbsp;</span><span class="src-var">$opts</span><span class="src-sym">[</span><span class="src-str">'db&nbsp;params'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a287"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a288"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a289"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a290"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a291"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;method&nbsp;may&nbsp;be&nbsp;used&nbsp;to&nbsp;share&nbsp;the&nbsp;connection&nbsp;with&nbsp;other,</span></div></li>
<li><div class="src-line"><a name="a292"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;non-QueryPath&nbsp;objects.</span></div></li>
<li><div class="src-line"><a name="a293"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a294"></a>&nbsp;&nbsp;<span class="src-key">static&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodgetBaseDB">getBaseDB</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span><span class="src-key">return&nbsp;</span><span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$con</span><span class="src-sym">;</span><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a295"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a296"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a297"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Used&nbsp;to&nbsp;control&nbsp;whether&nbsp;or&nbsp;not&nbsp;all&nbsp;rows&nbsp;in&nbsp;a&nbsp;result&nbsp;should&nbsp;be&nbsp;cycled&nbsp;through.</span></div></li>
<li><div class="src-line"><a name="a298"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a299"></a>&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#var$cycleRows">$cycleRows</a>&nbsp;=&nbsp;<span class="src-id">FALSE</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a300"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a301"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a302"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Construct&nbsp;a&nbsp;new&nbsp;QPDB&nbsp;object.&nbsp;This&nbsp;is&nbsp;usually&nbsp;done&nbsp;by&nbsp;QueryPath&nbsp;itself.</span></div></li>
<li><div class="src-line"><a name="a303"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a304"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-id">QueryPath&nbsp;</span><span class="src-var">$qp</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a305"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a>&nbsp;=&nbsp;<span class="src-var">$qp</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a306"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;By&nbsp;default,&nbsp;we&nbsp;set&nbsp;it&nbsp;up&nbsp;to&nbsp;use&nbsp;the&nbsp;base&nbsp;DB.</span></div></li>
<li><div class="src-line"><a name="a307"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$db">db</a>&nbsp;=&nbsp;<span class="src-id">self</span><span class="src-sym">::</span><span class="src-var">$con</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a308"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a309"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a310"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a311"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Create&nbsp;a&nbsp;new&nbsp;connection&nbsp;to&nbsp;the&nbsp;database.&nbsp;Use&nbsp;the&nbsp;PDO&nbsp;DSN&nbsp;syntax&nbsp;for&nbsp;a</span></div></li>
<li><div class="src-line"><a name="a312"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;connection&nbsp;string.</span></div></li>
<li><div class="src-line"><a name="a313"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a314"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;creates&nbsp;a&nbsp;database&nbsp;connection&nbsp;that&nbsp;will&nbsp;last&nbsp;for&nbsp;the&nbsp;duration&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a315"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;QueryPath&nbsp;object.&nbsp;This&nbsp;method&nbsp;ought&nbsp;to&nbsp;be&nbsp;used&nbsp;only&nbsp;in&nbsp;two&nbsp;cases:</span></div></li>
<li><div class="src-line"><a name="a316"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;-&nbsp;When&nbsp;you&nbsp;will&nbsp;only&nbsp;run&nbsp;a&nbsp;couple&nbsp;of&nbsp;queries&nbsp;during&nbsp;the&nbsp;life&nbsp;of&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a317"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;process.</span></div></li>
<li><div class="src-line"><a name="a318"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;-&nbsp;When&nbsp;you&nbsp;need&nbsp;to&nbsp;connect&nbsp;to&nbsp;a&nbsp;database&nbsp;that&nbsp;will&nbsp;only&nbsp;be&nbsp;used&nbsp;for</span></div></li>
<li><div class="src-line"><a name="a319"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;a&nbsp;few&nbsp;things.</span></div></li>
<li><div class="src-line"><a name="a320"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Otherwise,&nbsp;you&nbsp;should&nbsp;use&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPDB::baseDB}</span><span class="src-doc">&nbsp;to&nbsp;configure&nbsp;a&nbsp;single</span></div></li>
<li><div class="src-line"><a name="a321"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;database&nbsp;connection&nbsp;that&nbsp;all&nbsp;of&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QueryPath}</span><span class="src-doc">&nbsp;can&nbsp;share.</span></div></li>
<li><div class="src-line"><a name="a322"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a323"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&lt;b&gt;Remember&nbsp;to&nbsp;always&nbsp;use&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPDB::doneWithQuery()}</span><span class="src-doc">&nbsp;when&nbsp;you&nbsp;are&nbsp;done</span></div></li>
<li><div class="src-line"><a name="a324"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;with&nbsp;a&nbsp;query.&nbsp;It&nbsp;gives&nbsp;PDO&nbsp;a&nbsp;chance&nbsp;to&nbsp;clean&nbsp;up&nbsp;open&nbsp;connections&nbsp;that&nbsp;may</span></div></li>
<li><div class="src-line"><a name="a325"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;prevent&nbsp;other&nbsp;instances&nbsp;from&nbsp;accessing&nbsp;or&nbsp;modifying&nbsp;data.&lt;/b&gt;</span></div></li>
<li><div class="src-line"><a name="a326"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a327"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$dsn&nbsp;</span></div></li>
<li><div class="src-line"><a name="a328"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;PDO&nbsp;DSN&nbsp;connection&nbsp;string.</span></div></li>
<li><div class="src-line"><a name="a329"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc-var">$options&nbsp;</span></div></li>
<li><div class="src-line"><a name="a330"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;Connection&nbsp;options.&nbsp;The&nbsp;following&nbsp;options&nbsp;are&nbsp;supported:</span></div></li>
<li><div class="src-line"><a name="a331"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;-&nbsp;username&nbsp;=&gt;&nbsp;(string)</span></div></li>
<li><div class="src-line"><a name="a332"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;-&nbsp;password&nbsp;=&gt;&nbsp;(string)</span></div></li>
<li><div class="src-line"><a name="a333"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;-&nbsp;db&nbsp;params&nbsp;=&gt;&nbsp;(array)&nbsp;These&nbsp;will&nbsp;be&nbsp;passed&nbsp;into&nbsp;the&nbsp;new&nbsp;PDO&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a334"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;See&nbsp;the&nbsp;PDO&nbsp;documentation&nbsp;for&nbsp;a&nbsp;list&nbsp;of&nbsp;options.&nbsp;By&nbsp;default,&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a335"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;only&nbsp;flag&nbsp;set&nbsp;is&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;PDO::ATTR_ERRMODE}</span><span class="src-doc">,&nbsp;which&nbsp;is&nbsp;set&nbsp;to</span></div></li>
<li><div class="src-line"><a name="a336"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;PDO::ERRMODE_EXCEPTION}</span><span class="src-doc">.</span></div></li>
<li><div class="src-line"><a name="a337"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">QueryPath&nbsp;</span></div></li>
<li><div class="src-line"><a name="a338"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;QueryPath&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a339"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@throws</span><span class="src-doc">&nbsp;PDOException</span></div></li>
<li><div class="src-line"><a name="a340"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;PDO&nbsp;library&nbsp;is&nbsp;configured&nbsp;to&nbsp;throw&nbsp;exceptions,&nbsp;so&nbsp;any&nbsp;of&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a341"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;database&nbsp;functions&nbsp;may&nbsp;throw&nbsp;a&nbsp;PDOException.</span></div></li>
<li><div class="src-line"><a name="a342"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a343"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methoddbInit">dbInit</a><span class="src-sym">(</span><span class="src-var">$dsn</span><span class="src-sym">,&nbsp;</span><span class="src-var">$options&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a344"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$opts">opts</a>&nbsp;=&nbsp;<span class="src-var">$options&nbsp;</span>+&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a345"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'username'&nbsp;</span>=&gt;&nbsp;<span class="src-id">NULL</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a346"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'password'&nbsp;</span>=&gt;&nbsp;<span class="src-id">NULL</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a347"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'db&nbsp;params'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-id">PDO</span><span class="src-sym">::</span><span class="src-id">ATTR_ERRMODE&nbsp;</span>=&gt;&nbsp;<span class="src-id">PDO</span><span class="src-sym">::</span><span class="src-id">ERRMODE_EXCEPTION</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a348"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a349"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$dsn">dsn</a>&nbsp;=&nbsp;<span class="src-var">$dsn</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a350"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$db">db</a>&nbsp;=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">PDO</span><span class="src-sym">(</span><span class="src-var">$dsn</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a351"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$opts">opts</a><span class="src-sym">[</span><span class="src-str">'db&nbsp;params'</span><span class="src-sym">]&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$key&nbsp;</span>=&gt;&nbsp;<span class="src-var">$val</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a352"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$db">db</a><span class="src-sym">-&gt;</span><span class="src-id">setAttribute</span><span class="src-sym">(</span><span class="src-var">$key</span><span class="src-sym">,&nbsp;</span><span class="src-var">$val</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a353"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a354"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a355"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a356"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a357"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a358"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Execute&nbsp;a&nbsp;SQL&nbsp;query,&nbsp;and&nbsp;store&nbsp;the&nbsp;results.</span></div></li>
<li><div class="src-line"><a name="a359"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a360"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;will&nbsp;execute&nbsp;a&nbsp;SQL&nbsp;query&nbsp;(as&nbsp;a&nbsp;prepared&nbsp;statement),&nbsp;and&nbsp;then&nbsp;store</span></div></li>
<li><div class="src-line"><a name="a361"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;results&nbsp;internally&nbsp;for&nbsp;later&nbsp;use.&nbsp;The&nbsp;data&nbsp;can&nbsp;be&nbsp;iterated&nbsp;using</span></div></li>
<li><div class="src-line"><a name="a362"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;nextRow()}</span><span class="src-doc">.&nbsp;QueryPath&nbsp;can&nbsp;also&nbsp;be&nbsp;instructed&nbsp;to&nbsp;do&nbsp;internal&nbsp;iteration</span></div></li>
<li><div class="src-line"><a name="a363"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;using&nbsp;the&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;withEachRow()}</span><span class="src-doc">&nbsp;method.&nbsp;Finally,&nbsp;on&nbsp;the&nbsp;occasion&nbsp;that&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a364"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;statement&nbsp;itself&nbsp;is&nbsp;needed,&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;getStatement()}</span><span class="src-doc">&nbsp;can&nbsp;be&nbsp;used.</span></div></li>
<li><div class="src-line"><a name="a365"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a366"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Use&nbsp;this&nbsp;when&nbsp;you&nbsp;need&nbsp;to&nbsp;access&nbsp;the&nbsp;results&nbsp;of&nbsp;a&nbsp;query,&nbsp;or&nbsp;when&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a367"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;parameter&nbsp;to&nbsp;a&nbsp;query&nbsp;should&nbsp;be&nbsp;escaped.&nbsp;If&nbsp;the&nbsp;query&nbsp;takes&nbsp;no&nbsp;external</span></div></li>
<li><div class="src-line"><a name="a368"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;parameters&nbsp;and&nbsp;does&nbsp;not&nbsp;return&nbsp;results,&nbsp;you&nbsp;may&nbsp;wish&nbsp;to&nbsp;use&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a369"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;(ever&nbsp;so&nbsp;slightly&nbsp;faster)&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;exec()}</span><span class="src-doc">&nbsp;function&nbsp;instead.</span></div></li>
<li><div class="src-line"><a name="a370"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a371"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Make&nbsp;sure&nbsp;you&nbsp;use&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;doneWithQuery()}</span><span class="src-doc">&nbsp;after&nbsp;finishing&nbsp;with&nbsp;the&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a372"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;results&nbsp;returned&nbsp;by&nbsp;this&nbsp;method.</span></div></li>
<li><div class="src-line"><a name="a373"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a374"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&lt;b&gt;Usage&lt;/b&gt;</span></div></li>
<li><div class="src-line"><a name="a375"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a376"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Here&nbsp;is&nbsp;a&nbsp;simple&nbsp;example:</span></div></li>
<li><div class="src-line"><a name="a377"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&lt;code&gt;</span></div></li>
<li><div class="src-line"><a name="a378"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&lt;?php</span></div></li>
<li><div class="src-line"><a name="a379"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;QPQDB::baseDB($someDSN);</span></div></li>
<li><div class="src-line"><a name="a380"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a381"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;$args&nbsp;=&nbsp;array(':something'&nbsp;=&gt;&nbsp;'myColumn');</span></div></li>
<li><div class="src-line"><a name="a382"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;qp()-&gt;query('SELECT&nbsp;:something&nbsp;FROM&nbsp;foo',&nbsp;$args)-&gt;doneWithQuery();</span></div></li>
<li><div class="src-line"><a name="a383"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a384"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&lt;/code&gt;</span></div></li>
<li><div class="src-line"><a name="a385"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a386"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;above&nbsp;would&nbsp;execute&nbsp;the&nbsp;given&nbsp;query,&nbsp;substituting&nbsp;myColumn&nbsp;in&nbsp;place&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a387"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;:something&nbsp;before&nbsp;executing&nbsp;the&nbsp;query&nbsp;The&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;doneWithQuery()}</span><span class="src-doc">&nbsp;method</span></div></li>
<li><div class="src-line"><a name="a388"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;indicates&nbsp;that&nbsp;we&nbsp;are&nbsp;not&nbsp;going&nbsp;to&nbsp;use&nbsp;the&nbsp;results&nbsp;for&nbsp;anything.&nbsp;This&nbsp;method</span></div></li>
<li><div class="src-line"><a name="a389"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;discards&nbsp;the&nbsp;results.</span></div></li>
<li><div class="src-line"><a name="a390"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a391"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;A&nbsp;more&nbsp;typical&nbsp;use&nbsp;of&nbsp;the&nbsp;query()&nbsp;function&nbsp;would&nbsp;involve&nbsp;inserting&nbsp;data</span></div></li>
<li><div class="src-line"><a name="a392"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;using&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;appendColumn()}</span><span class="src-doc">,&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;prependColumn()}</span><span class="src-doc">,&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;columnBefore()}</span><span class="src-doc">,</span></div></li>
<li><div class="src-line"><a name="a393"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;or&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;columnAfter()}</span><span class="src-doc">.&nbsp;See&nbsp;the&nbsp;main&nbsp;documentation&nbsp;for&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPDB}</span><span class="src-doc">&nbsp;to&nbsp;view</span></div></li>
<li><div class="src-line"><a name="a394"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;a&nbsp;more&nbsp;realistic&nbsp;example.</span></div></li>
<li><div class="src-line"><a name="a395"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a396"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$sql&nbsp;</span></div></li>
<li><div class="src-line"><a name="a397"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;query&nbsp;to&nbsp;be&nbsp;executed.</span></div></li>
<li><div class="src-line"><a name="a398"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc-var">$args&nbsp;</span></div></li>
<li><div class="src-line"><a name="a399"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;An&nbsp;associative&nbsp;array&nbsp;of&nbsp;substitutions&nbsp;to&nbsp;make.</span></div></li>
<li><div class="src-line"><a name="a400"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@throws</span><span class="src-doc">&nbsp;PDOException</span></div></li>
<li><div class="src-line"><a name="a401"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;Throws&nbsp;an&nbsp;exception&nbsp;if&nbsp;the&nbsp;query&nbsp;cannot&nbsp;be&nbsp;executed.</span></div></li>
<li><div class="src-line"><a name="a402"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a403"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodquery">query</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">,&nbsp;</span><span class="src-var">$args&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a404"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$stmt">stmt</a>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$db">db</a><span class="src-sym">-&gt;</span><span class="src-id">prepare</span><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a405"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$stmt">stmt</a><span class="src-sym">-&gt;</span><span class="src-id">execute</span><span class="src-sym">(</span><span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a406"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a407"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a408"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a409"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a410"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Query&nbsp;and&nbsp;append&nbsp;the&nbsp;results.</span></div></li>
<li><div class="src-line"><a name="a411"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a412"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Run&nbsp;a&nbsp;query&nbsp;and&nbsp;inject&nbsp;the&nbsp;results&nbsp;directly&nbsp;into&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a413"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;elements&nbsp;in&nbsp;the&nbsp;QueryPath&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a414"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a415"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;the&nbsp;third&nbsp;argument&nbsp;is&nbsp;empty,&nbsp;the&nbsp;data&nbsp;will&nbsp;be&nbsp;inserted&nbsp;directly&nbsp;into</span></div></li>
<li><div class="src-line"><a name="a416"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;QueryPath&nbsp;elements&nbsp;unaltered.&nbsp;However,&nbsp;if&nbsp;a&nbsp;template&nbsp;is&nbsp;provided&nbsp;in</span></div></li>
<li><div class="src-line"><a name="a417"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;the&nbsp;third&nbsp;parameter,&nbsp;the&nbsp;query&nbsp;data&nbsp;will&nbsp;be&nbsp;merged&nbsp;into&nbsp;that&nbsp;template</span></div></li>
<li><div class="src-line"><a name="a418"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;and&nbsp;then&nbsp;be&nbsp;added&nbsp;to&nbsp;each&nbsp;QueryPath&nbsp;element.</span></div></li>
<li><div class="src-line"><a name="a419"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a420"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;template&nbsp;will&nbsp;be&nbsp;merged&nbsp;once&nbsp;for&nbsp;each&nbsp;row,&nbsp;even&nbsp;if&nbsp;no&nbsp;row&nbsp;data&nbsp;is</span></div></li>
<li><div class="src-line"><a name="a421"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;appended&nbsp;into&nbsp;the&nbsp;template.</span></div></li>
<li><div class="src-line"><a name="a422"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a423"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;A&nbsp;template&nbsp;is&nbsp;simply&nbsp;a&nbsp;piece&nbsp;of&nbsp;markup&nbsp;labeled&nbsp;for&nbsp;insertion&nbsp;of</span></div></li>
<li><div class="src-line"><a name="a424"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;data.&nbsp;See&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPTPL}</span><span class="src-doc">&nbsp;and&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPTPL.php}</span><span class="src-doc">&nbsp;for&nbsp;more&nbsp;information.</span></div></li>
<li><div class="src-line"><a name="a425"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a426"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Since&nbsp;this&nbsp;does&nbsp;not&nbsp;use&nbsp;a&nbsp;stanard&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;query()}</span><span class="src-doc">,&nbsp;there&nbsp;is&nbsp;no&nbsp;need</span></div></li>
<li><div class="src-line"><a name="a427"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;to&nbsp;call&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;doneWithQuery()}</span><span class="src-doc">&nbsp;after&nbsp;this&nbsp;method.</span></div></li>
<li><div class="src-line"><a name="a428"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a429"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$sql&nbsp;</span></div></li>
<li><div class="src-line"><a name="a430"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;SQL&nbsp;query&nbsp;to&nbsp;execute.&nbsp;In&nbsp;this&nbsp;context,&nbsp;the&nbsp;query&nbsp;is&nbsp;typically&nbsp;a</span></div></li>
<li><div class="src-line"><a name="a431"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;SELECT&nbsp;statement.</span></div></li>
<li><div class="src-line"><a name="a432"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">array&nbsp;</span><span class="src-doc-var">$args&nbsp;</span></div></li>
<li><div class="src-line"><a name="a433"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;An&nbsp;array&nbsp;of&nbsp;arguments&nbsp;to&nbsp;be&nbsp;substituted&nbsp;into&nbsp;the&nbsp;query.&nbsp;See&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;query()}</span></div></li>
<li><div class="src-line"><a name="a434"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;for&nbsp;details.</span></div></li>
<li><div class="src-line"><a name="a435"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc-var">$template&nbsp;</span></div></li>
<li><div class="src-line"><a name="a436"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;A&nbsp;template&nbsp;into&nbsp;which&nbsp;query&nbsp;results&nbsp;will&nbsp;be&nbsp;merged&nbsp;prior&nbsp;to&nbsp;being&nbsp;appended</span></div></li>
<li><div class="src-line"><a name="a437"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;into&nbsp;the&nbsp;QueryPath.&nbsp;For&nbsp;details&nbsp;on&nbsp;the&nbsp;template,&nbsp;see&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPTPL::tpl()}</span><span class="src-doc">.</span></div></li>
<li><div class="src-line"><a name="a438"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QPTPL.php</span></div></li>
<li><div class="src-line"><a name="a439"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QPTPL::tpl()</span></div></li>
<li><div class="src-line"><a name="a440"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;query()</span></div></li>
<li><div class="src-line"><a name="a441"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a442"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodqueryInto">queryInto</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">,&nbsp;</span><span class="src-var">$args&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$template&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a443"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stmt&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$db">db</a><span class="src-sym">-&gt;</span><span class="src-id">prepare</span><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a444"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stmt</span><span class="src-sym">-&gt;</span><span class="src-id">setFetchMode</span><span class="src-sym">(</span><span class="src-id">PDO</span><span class="src-sym">::</span><span class="src-id">FETCH_ASSOC</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a445"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stmt</span><span class="src-sym">-&gt;</span><span class="src-id">execute</span><span class="src-sym">(</span><span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a446"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a447"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;If&nbsp;no&nbsp;template,&nbsp;put&nbsp;all&nbsp;values&nbsp;in&nbsp;together.</span></div></li>
<li><div class="src-line"><a name="a448"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$template</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a449"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$stmt&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$row</span><span class="src-sym">)&nbsp;</span><span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$row&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$datum</span><span class="src-sym">)&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a><span class="src-sym">-&gt;</span><span class="src-id">append</span><span class="src-sym">(</span><span class="src-var">$datum</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a450"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a451"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Otherwise,&nbsp;we&nbsp;run&nbsp;the&nbsp;results&nbsp;through&nbsp;a&nbsp;template,&nbsp;and&nbsp;then&nbsp;append.</span></div></li>
<li><div class="src-line"><a name="a452"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a453"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$stmt&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$row</span><span class="src-sym">)&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a><span class="src-sym">-&gt;</span><span class="src-id">tpl</span><span class="src-sym">(</span><span class="src-var">$template</span><span class="src-sym">,&nbsp;</span><span class="src-var">$row</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a454"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a455"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a456"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$stmt</span><span class="src-sym">-&gt;</span><span class="src-id">closeCursor</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a457"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a458"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a459"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a460"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a461"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Free&nbsp;up&nbsp;resources&nbsp;when&nbsp;a&nbsp;query&nbsp;is&nbsp;no&nbsp;longer&nbsp;used.</span></div></li>
<li><div class="src-line"><a name="a462"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a463"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;function&nbsp;should&nbsp;&lt;i&gt;always&lt;/i&gt;&nbsp;be&nbsp;called&nbsp;when&nbsp;the&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a464"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;results&nbsp;for&nbsp;a&nbsp;query&nbsp;are&nbsp;no&nbsp;longer&nbsp;needed.&nbsp;This&nbsp;frees&nbsp;up&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a465"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;database&nbsp;cursor,&nbsp;discards&nbsp;the&nbsp;data,&nbsp;and&nbsp;resets&nbsp;resources&nbsp;for&nbsp;future</span></div></li>
<li><div class="src-line"><a name="a466"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;use.</span></div></li>
<li><div class="src-line"><a name="a467"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a468"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;this&nbsp;method&nbsp;is&nbsp;not&nbsp;called,&nbsp;some&nbsp;PDO&nbsp;database&nbsp;drivers&nbsp;will&nbsp;not&nbsp;allow</span></div></li>
<li><div class="src-line"><a name="a469"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;subsequent&nbsp;queries,&nbsp;while&nbsp;others&nbsp;will&nbsp;keep&nbsp;tables&nbsp;in&nbsp;a&nbsp;locked&nbsp;state&nbsp;where</span></div></li>
<li><div class="src-line"><a name="a470"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;writes&nbsp;will&nbsp;not&nbsp;be&nbsp;allowed.</span></div></li>
<li><div class="src-line"><a name="a471"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a472"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">QueryPath&nbsp;</span></div></li>
<li><div class="src-line"><a name="a473"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;QueryPath&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a474"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a475"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methoddoneWithQuery">doneWithQuery</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a476"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$stmt">stmt</a><span class="src-sym">)&nbsp;</span>&amp;&amp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$stmt">stmt</a>&nbsp;instanceof&nbsp;<span class="src-id">PDOStatement</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a477"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$stmt">stmt</a><span class="src-sym">-&gt;</span><span class="src-id">closeCursor</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a478"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a479"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a480"></a>&nbsp;&nbsp;&nbsp;&nbsp;unset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$stmt">stmt</a><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a481"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$row">row</a>&nbsp;=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a482"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$cycleRows">cycleRows</a>&nbsp;=&nbsp;<span class="src-id">FALSE</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a483"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a484"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a485"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a486"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a487"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Execute&nbsp;a&nbsp;SQL&nbsp;query,&nbsp;but&nbsp;expect&nbsp;no&nbsp;value.</span></div></li>
<li><div class="src-line"><a name="a488"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span></div></li>
<li><div class="src-line"><a name="a489"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;If&nbsp;your&nbsp;SQL&nbsp;query&nbsp;will&nbsp;have&nbsp;parameters,&nbsp;you&nbsp;are&nbsp;encouraged&nbsp;to</span></div></li>
<li><div class="src-line"><a name="a490"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;use&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;query()}</span><span class="src-doc">,&nbsp;which&nbsp;includes&nbsp;built-in&nbsp;SQL&nbsp;Injection</span></div></li>
<li><div class="src-line"><a name="a491"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;protection.</span></div></li>
<li><div class="src-line"><a name="a492"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a493"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$sql&nbsp;</span></div></li>
<li><div class="src-line"><a name="a494"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;A&nbsp;SQL&nbsp;statement.</span></div></li>
<li><div class="src-line"><a name="a495"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@throws</span><span class="src-doc">&nbsp;PDOException</span></div></li>
<li><div class="src-line"><a name="a496"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;An&nbsp;exception&nbsp;will&nbsp;be&nbsp;thrown&nbsp;if&nbsp;a&nbsp;query&nbsp;cannot&nbsp;be&nbsp;executed.</span></div></li>
<li><div class="src-line"><a name="a497"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a498"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodexec">exec</a><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a499"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$db">db</a><span class="src-sym">-&gt;</span><span class="src-id">exec</span><span class="src-sym">(</span><span class="src-var">$sql</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a500"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a501"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a502"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a503"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a504"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Advance&nbsp;the&nbsp;query&nbsp;results&nbsp;row&nbsp;cursor.</span></div></li>
<li><div class="src-line"><a name="a505"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a506"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;In&nbsp;a&nbsp;result&nbsp;set&nbsp;where&nbsp;more&nbsp;than&nbsp;one&nbsp;row&nbsp;was&nbsp;returned,&nbsp;this&nbsp;will</span></div></li>
<li><div class="src-line"><a name="a507"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;move&nbsp;the&nbsp;pointer&nbsp;to&nbsp;the&nbsp;next&nbsp;row&nbsp;in&nbsp;the&nbsp;set.</span></div></li>
<li><div class="src-line"><a name="a508"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a509"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;PDO&nbsp;library&nbsp;does&nbsp;not&nbsp;have&nbsp;a&nbsp;consistent&nbsp;way&nbsp;of&nbsp;determining&nbsp;how&nbsp;many</span></div></li>
<li><div class="src-line"><a name="a510"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;rows&nbsp;a&nbsp;result&nbsp;set&nbsp;has.&nbsp;The&nbsp;suggested&nbsp;technique&nbsp;is&nbsp;to&nbsp;first&nbsp;execute&nbsp;a</span></div></li>
<li><div class="src-line"><a name="a511"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;COUNT()&nbsp;SQL&nbsp;query&nbsp;and&nbsp;get&nbsp;the&nbsp;data&nbsp;from&nbsp;that.</span></div></li>
<li><div class="src-line"><a name="a512"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a513"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;The&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;withEachRow()}</span><span class="src-doc">&nbsp;method&nbsp;will&nbsp;begin&nbsp;at&nbsp;the&nbsp;next&nbsp;row&nbsp;after&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a514"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;currently&nbsp;selected&nbsp;one.</span></div></li>
<li><div class="src-line"><a name="a515"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a516"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">QueryPath&nbsp;</span></div></li>
<li><div class="src-line"><a name="a517"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;QueryPath&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a518"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a519"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodnextRow">nextRow</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a520"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$row">row</a>&nbsp;=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$stmt">stmt</a><span class="src-sym">-&gt;</span><span class="src-id">fetch</span><span class="src-sym">(</span><span class="src-id">PDO</span><span class="src-sym">::</span><span class="src-id">FETCH_ASSOC</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a521"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a522"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a523"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a524"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a525"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Set&nbsp;the&nbsp;object&nbsp;to&nbsp;use&nbsp;each&nbsp;row,&nbsp;instead&nbsp;of&nbsp;only&nbsp;one&nbsp;row.</span></div></li>
<li><div class="src-line"><a name="a526"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a527"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;is&nbsp;used&nbsp;primarily&nbsp;to&nbsp;instruct&nbsp;QPDB&nbsp;to&nbsp;iterate&nbsp;through&nbsp;all&nbsp;of&nbsp;the</span></div></li>
<li><div class="src-line"><a name="a528"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;rows&nbsp;when&nbsp;appending,&nbsp;prepending,&nbsp;inserting&nbsp;before,&nbsp;or&nbsp;inserting&nbsp;after.</span></div></li>
<li><div class="src-line"><a name="a529"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a530"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">QueryPath&nbsp;</span></div></li>
<li><div class="src-line"><a name="a531"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;QueryPath&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a532"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;appendColumn()</span></div></li>
<li><div class="src-line"><a name="a533"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;prependColumn()</span></div></li>
<li><div class="src-line"><a name="a534"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;columnBefore()</span></div></li>
<li><div class="src-line"><a name="a535"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;columnAfter()</span></div></li>
<li><div class="src-line"><a name="a536"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a537"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodwithEachRow">withEachRow</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a538"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$cycleRows">cycleRows</a>&nbsp;=&nbsp;<span class="src-id">TRUE</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a539"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a540"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a541"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a542"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a543"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;is&nbsp;the&nbsp;implementation&nbsp;behind&nbsp;the&nbsp;append/prepend&nbsp;and&nbsp;before/after&nbsp;methods.</span></div></li>
<li><div class="src-line"><a name="a544"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a545"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc-var">$columnName&nbsp;</span></div></li>
<li><div class="src-line"><a name="a546"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;name&nbsp;of&nbsp;the&nbsp;column&nbsp;whose&nbsp;data&nbsp;should&nbsp;be&nbsp;added&nbsp;to&nbsp;the&nbsp;currently&nbsp;selected</span></div></li>
<li><div class="src-line"><a name="a547"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;elements.&nbsp;This&nbsp;can&nbsp;be&nbsp;either&nbsp;a&nbsp;string&nbsp;or&nbsp;an&nbsp;array&nbsp;of&nbsp;strings.</span></div></li>
<li><div class="src-line"><a name="a548"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$qpFunc&nbsp;</span></div></li>
<li><div class="src-line"><a name="a549"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;name&nbsp;of&nbsp;the&nbsp;QueryPath&nbsp;function&nbsp;that&nbsp;should&nbsp;be&nbsp;executed&nbsp;to&nbsp;insert&nbsp;data</span></div></li>
<li><div class="src-line"><a name="a550"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;into&nbsp;the&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a551"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$wrap&nbsp;</span></div></li>
<li><div class="src-line"><a name="a552"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;The&nbsp;HTML/XML&nbsp;markup&nbsp;that&nbsp;will&nbsp;be&nbsp;used&nbsp;to&nbsp;wrap&nbsp;around&nbsp;the&nbsp;column&nbsp;data&nbsp;before</span></div></li>
<li><div class="src-line"><a name="a553"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;the&nbsp;data&nbsp;is&nbsp;inserted&nbsp;into&nbsp;the&nbsp;QueryPath&nbsp;object.</span></div></li>
<li><div class="src-line"><a name="a554"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a555"></a>&nbsp;&nbsp;<span class="src-key">protected&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodaddData">addData</a><span class="src-sym">(</span><span class="src-var">$columnName</span><span class="src-sym">,&nbsp;</span><span class="src-var">$qpFunc&nbsp;</span>=&nbsp;<span class="src-str">'append'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a556"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$columns&nbsp;</span>=&nbsp;<a href="http://www.php.net/is_array">is_array</a><span class="src-sym">(</span><span class="src-var">$columnName</span><span class="src-sym">)&nbsp;</span>?&nbsp;<span class="src-var">$columnName&nbsp;</span>:&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$columnName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a557"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$hasWrap&nbsp;</span>=&nbsp;<span class="src-sym">!</span><span class="src-key">empty</span><span class="src-sym">(</span><span class="src-var">$wrap</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a558"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$cycleRows">cycleRows</a><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a559"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">while&nbsp;</span><span class="src-sym">((</span><span class="src-var">$row&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$stmt">stmt</a><span class="src-sym">-&gt;</span><span class="src-id">fetch</span><span class="src-sym">(</span><span class="src-id">PDO</span><span class="src-sym">::</span><span class="src-id">FETCH_ASSOC</span><span class="src-sym">))&nbsp;</span>!==&nbsp;<span class="src-id">FALSE</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a560"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$columns&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$col</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a561"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$row</span><span class="src-sym">[</span><span class="src-var">$col</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a562"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$data&nbsp;</span>=&nbsp;<span class="src-var">$row</span><span class="src-sym">[</span><span class="src-var">$col</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a563"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$hasWrap</span><span class="src-sym">)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a564"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$data&nbsp;</span>=&nbsp;<a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-var">$wrap</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">deepest</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">append</span><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">top</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a565"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a><span class="src-sym">-&gt;</span><span class="src-var">$qpFunc</span><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a566"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a567"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a568"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a569"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$cycleRows">cycleRows</a>&nbsp;=&nbsp;<span class="src-id">FALSE</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a570"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#methoddoneWithQuery">doneWithQuery</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a571"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a572"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">else&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a573"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$row">row</a>&nbsp;!==&nbsp;<span class="src-id">FALSE</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a574"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$columns&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$col</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a575"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span>isset<span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$row">row</a><span class="src-sym">[</span><span class="src-var">$col</span><span class="src-sym">]</span><span class="src-sym">))&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a576"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$data&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$row">row</a><span class="src-sym">[</span><span class="src-var">$col</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a577"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-var">$hasWrap</span><span class="src-sym">)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a578"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$data&nbsp;</span>=&nbsp;<a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-var">$wrap</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">deepest</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">append</span><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">top</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a579"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a><span class="src-sym">-&gt;</span><span class="src-var">$qpFunc</span><span class="src-sym">(</span><span class="src-var">$data</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a580"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a581"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a582"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a583"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a584"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$qp">qp</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a585"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a586"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a587"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a588"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Get&nbsp;back&nbsp;the&nbsp;raw&nbsp;PDOStatement&nbsp;object&nbsp;after&nbsp;a&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;query()}</span><span class="src-doc">.</span></div></li>
<li><div class="src-line"><a name="a589"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a590"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@return&nbsp;</span><span class="src-doc-type">PDOStatement&nbsp;</span></div></li>
<li><div class="src-line"><a name="a591"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;Return&nbsp;the&nbsp;PDO&nbsp;statement&nbsp;object.&nbsp;If&nbsp;this&nbsp;is&nbsp;called&nbsp;and&nbsp;no&nbsp;statement</span></div></li>
<li><div class="src-line"><a name="a592"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;has&nbsp;been&nbsp;executed&nbsp;(or&nbsp;the&nbsp;statement&nbsp;has&nbsp;already&nbsp;been&nbsp;cleaned&nbsp;up),</span></div></li>
<li><div class="src-line"><a name="a593"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;this&nbsp;will&nbsp;return&nbsp;NULL.</span></div></li>
<li><div class="src-line"><a name="a594"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a595"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodgetStatement">getStatement</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a596"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#var$stmt">stmt</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a597"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a598"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a599"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a600"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Append&nbsp;the&nbsp;data&nbsp;in&nbsp;the&nbsp;given&nbsp;column(s)&nbsp;to&nbsp;the&nbsp;QueryPath.</span></div></li>
<li><div class="src-line"><a name="a601"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a602"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;appends&nbsp;data&nbsp;to&nbsp;every&nbsp;item&nbsp;in&nbsp;the&nbsp;current&nbsp;QueryPath.&nbsp;The&nbsp;data&nbsp;will</span></div></li>
<li><div class="src-line"><a name="a603"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;be&nbsp;retrieved&nbsp;from&nbsp;the&nbsp;database&nbsp;result,&nbsp;using&nbsp;$columnName&nbsp;as&nbsp;the&nbsp;key.</span></div></li>
<li><div class="src-line"><a name="a604"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a605"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc-var">$columnName&nbsp;</span></div></li>
<li><div class="src-line"><a name="a606"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;Either&nbsp;a&nbsp;string&nbsp;or&nbsp;an&nbsp;array&nbsp;of&nbsp;strings.&nbsp;The&nbsp;value(s)&nbsp;here&nbsp;should&nbsp;match</span></div></li>
<li><div class="src-line"><a name="a607"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;one&nbsp;or&nbsp;more&nbsp;column&nbsp;headers&nbsp;from&nbsp;the&nbsp;current&nbsp;SQL&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;query}</span><span class="src-doc">'s&nbsp;results.</span></div></li>
<li><div class="src-line"><a name="a608"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$wrap&nbsp;</span></div></li>
<li><div class="src-line"><a name="a609"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;IF&nbsp;this&nbsp;is&nbsp;supplied,&nbsp;then&nbsp;the&nbsp;value&nbsp;or&nbsp;values&nbsp;retrieved&nbsp;from&nbsp;the&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a610"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;wrapped&nbsp;in&nbsp;this&nbsp;HTML/XML&nbsp;before&nbsp;being&nbsp;inserted&nbsp;into&nbsp;the&nbsp;QueryPath.</span></div></li>
<li><div class="src-line"><a name="a611"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QueryPath::wrap()</span></div></li>
<li><div class="src-line"><a name="a612"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QueryPath::append()</span></div></li>
<li><div class="src-line"><a name="a613"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a614"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodappendColumn">appendColumn</a><span class="src-sym">(</span><span class="src-var">$columnName</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a615"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#methodaddData">addData</a><span class="src-sym">(</span><span class="src-var">$columnName</span><span class="src-sym">,&nbsp;</span><span class="src-str">'append'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a616"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a617"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a618"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a619"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Prepend&nbsp;the&nbsp;data&nbsp;from&nbsp;the&nbsp;given&nbsp;column&nbsp;into&nbsp;the&nbsp;QueryPath.</span></div></li>
<li><div class="src-line"><a name="a620"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a621"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;takes&nbsp;the&nbsp;data&nbsp;from&nbsp;the&nbsp;given&nbsp;column(s)&nbsp;and&nbsp;inserts&nbsp;it&nbsp;into&nbsp;each</span></div></li>
<li><div class="src-line"><a name="a622"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;element&nbsp;currently&nbsp;found&nbsp;in&nbsp;the&nbsp;QueryPath.</span></div></li>
<li><div class="src-line"><a name="a623"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc-var">$columnName&nbsp;</span></div></li>
<li><div class="src-line"><a name="a624"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;Either&nbsp;a&nbsp;string&nbsp;or&nbsp;an&nbsp;array&nbsp;of&nbsp;strings.&nbsp;The&nbsp;value(s)&nbsp;here&nbsp;should&nbsp;match</span></div></li>
<li><div class="src-line"><a name="a625"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;one&nbsp;or&nbsp;more&nbsp;column&nbsp;headers&nbsp;from&nbsp;the&nbsp;current&nbsp;SQL&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;query}</span><span class="src-doc">'s&nbsp;results.</span></div></li>
<li><div class="src-line"><a name="a626"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$wrap&nbsp;</span></div></li>
<li><div class="src-line"><a name="a627"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;IF&nbsp;this&nbsp;is&nbsp;supplied,&nbsp;then&nbsp;the&nbsp;value&nbsp;or&nbsp;values&nbsp;retrieved&nbsp;from&nbsp;the&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a628"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;wrapped&nbsp;in&nbsp;this&nbsp;HTML/XML&nbsp;before&nbsp;being&nbsp;inserted&nbsp;into&nbsp;the&nbsp;QueryPath.</span></div></li>
<li><div class="src-line"><a name="a629"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QueryPath::wrap()</span></div></li>
<li><div class="src-line"><a name="a630"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QueryPath::prepend()</span></div></li>
<li><div class="src-line"><a name="a631"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a632"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodprependColumn">prependColumn</a><span class="src-sym">(</span><span class="src-var">$columnName</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a633"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#methodaddData">addData</a><span class="src-sym">(</span><span class="src-var">$columnName</span><span class="src-sym">,&nbsp;</span><span class="src-str">'prepend'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a634"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a635"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a636"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a637"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Insert&nbsp;the&nbsp;data&nbsp;from&nbsp;the&nbsp;given&nbsp;column&nbsp;before&nbsp;each&nbsp;element&nbsp;in&nbsp;the&nbsp;QueryPath.</span></div></li>
<li><div class="src-line"><a name="a638"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a639"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;inserts&nbsp;the&nbsp;data&nbsp;before&nbsp;each&nbsp;element&nbsp;in&nbsp;the&nbsp;currently&nbsp;matched&nbsp;QueryPath.</span></div></li>
<li><div class="src-line"><a name="a640"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a641"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc-var">$columnName&nbsp;</span></div></li>
<li><div class="src-line"><a name="a642"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;Either&nbsp;a&nbsp;string&nbsp;or&nbsp;an&nbsp;array&nbsp;of&nbsp;strings.&nbsp;The&nbsp;value(s)&nbsp;here&nbsp;should&nbsp;match</span></div></li>
<li><div class="src-line"><a name="a643"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;one&nbsp;or&nbsp;more&nbsp;column&nbsp;headers&nbsp;from&nbsp;the&nbsp;current&nbsp;SQL&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;query}</span><span class="src-doc">'s&nbsp;results.</span></div></li>
<li><div class="src-line"><a name="a644"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$wrap&nbsp;</span></div></li>
<li><div class="src-line"><a name="a645"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;IF&nbsp;this&nbsp;is&nbsp;supplied,&nbsp;then&nbsp;the&nbsp;value&nbsp;or&nbsp;values&nbsp;retrieved&nbsp;from&nbsp;the&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a646"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;wrapped&nbsp;in&nbsp;this&nbsp;HTML/XML&nbsp;before&nbsp;being&nbsp;inserted&nbsp;into&nbsp;the&nbsp;QueryPath.</span></div></li>
<li><div class="src-line"><a name="a647"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QueryPath::wrap()</span></div></li>
<li><div class="src-line"><a name="a648"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QueryPath::before()</span></div></li>
<li><div class="src-line"><a name="a649"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;prependColumn()</span></div></li>
<li><div class="src-line"><a name="a650"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a651"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodcolumnBefore">columnBefore</a><span class="src-sym">(</span><span class="src-var">$columnName</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a652"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#methodaddData">addData</a><span class="src-sym">(</span><span class="src-var">$columnName</span><span class="src-sym">,&nbsp;</span><span class="src-str">'before'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a653"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a654"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a655"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a656"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;Insert&nbsp;data&nbsp;from&nbsp;the&nbsp;given&nbsp;column(s)&nbsp;after&nbsp;each&nbsp;element&nbsp;in&nbsp;the&nbsp;QueryPath.</span></div></li>
<li><div class="src-line"><a name="a657"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a658"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;This&nbsp;inserts&nbsp;data&nbsp;from&nbsp;the&nbsp;given&nbsp;columns&nbsp;after&nbsp;each&nbsp;element&nbsp;in&nbsp;the&nbsp;QueryPath</span></div></li>
<li><div class="src-line"><a name="a659"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;object.&nbsp;IF&nbsp;HTML/XML&nbsp;is&nbsp;given&nbsp;in&nbsp;the&nbsp;$wrap&nbsp;parameter,&nbsp;then&nbsp;the&nbsp;column&nbsp;data</span></div></li>
<li><div class="src-line"><a name="a660"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;will&nbsp;be&nbsp;wrapped&nbsp;in&nbsp;that&nbsp;markup&nbsp;before&nbsp;being&nbsp;inserted&nbsp;into&nbsp;the&nbsp;QueryPath.</span></div></li>
<li><div class="src-line"><a name="a661"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a662"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">mixed&nbsp;</span><span class="src-doc-var">$columnName&nbsp;</span></div></li>
<li><div class="src-line"><a name="a663"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;Either&nbsp;a&nbsp;string&nbsp;or&nbsp;an&nbsp;array&nbsp;of&nbsp;strings.&nbsp;The&nbsp;value(s)&nbsp;here&nbsp;should&nbsp;match</span></div></li>
<li><div class="src-line"><a name="a664"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;one&nbsp;or&nbsp;more&nbsp;column&nbsp;headers&nbsp;from&nbsp;the&nbsp;current&nbsp;SQL&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;query}</span><span class="src-doc">'s&nbsp;results.</span></div></li>
<li><div class="src-line"><a name="a665"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@param&nbsp;</span><span class="src-doc-type">string&nbsp;</span><span class="src-doc-var">$wrap&nbsp;</span></div></li>
<li><div class="src-line"><a name="a666"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;IF&nbsp;this&nbsp;is&nbsp;supplied,&nbsp;then&nbsp;the&nbsp;value&nbsp;or&nbsp;values&nbsp;retrieved&nbsp;from&nbsp;the&nbsp;database</span></div></li>
<li><div class="src-line"><a name="a667"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;will&nbsp;be&nbsp;wrapped&nbsp;in&nbsp;this&nbsp;HTML/XML&nbsp;before&nbsp;being&nbsp;inserted&nbsp;into&nbsp;the&nbsp;QueryPath.</span></div></li>
<li><div class="src-line"><a name="a668"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QueryPath::wrap()</span></div></li>
<li><div class="src-line"><a name="a669"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;QueryPath::after()</span></div></li>
<li><div class="src-line"><a name="a670"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-coretag">@see</span><span class="src-doc">&nbsp;appendColumn()</span></div></li>
<li><div class="src-line"><a name="a671"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a672"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../QueryPath/Extension/QPDB.html#methodcolumnAfter">columnAfter</a><span class="src-sym">(</span><span class="src-var">$columnName</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a673"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../QueryPath/Extension/QPDB.html#methodaddData">addData</a><span class="src-sym">(</span><span class="src-var">$columnName</span><span class="src-sym">,&nbsp;</span><span class="src-str">'after'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$wrap</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a674"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a675"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a676"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a677"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a678"></a><span class="src-comm">//&nbsp;The&nbsp;define&nbsp;allows&nbsp;another&nbsp;class&nbsp;to&nbsp;extend&nbsp;this.</span></div></li>
<li><div class="src-line"><a name="a679"></a><span class="src-key">if&nbsp;</span><span class="src-sym">(</span><span class="src-sym">!</span><a href="http://www.php.net/defined">defined</a><span class="src-sym">(</span><span class="src-str">'QPDB_OVERRIDE'</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a680"></a>&nbsp;&nbsp;<span class="src-id"><a href="../QueryPath/QueryPathExtensionRegistry.html">QueryPathExtensionRegistry</a></span><span class="src-sym">::</span><a href="../QueryPath/QueryPathExtensionRegistry.html#methodextend">extend</a><span class="src-sym">(</span><span class="src-str">'QPDB'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol>
</span></div>
        <div class="credit">
		    <hr class="separator" />
		    Documentation generated on Thu, 19 Mar 2009 18:01:10 -0500 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.2</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>